/* 
 * File:   Movable.cpp
 * Author: fabienlenoir
 * 
 * Created on September 5, 2009, 1:31 AM
 */

#include "Movable.h"

Movable::Movable() {
}

Movable::Movable(const Movable& orig) {
}

Movable::~Movable() {
}

void Movable::moveRight(){
    _facing = RIGHT;
    if(_location != 0)
        if  (_location->getRightSide() != 0)
            _location->getRightSide()->enter(this);
}

void Movable::moveUp(){
    _facing = UP;
    if(_location != 0)
        if  (_location->getTopSite() != 0)
            _location->getTopSite()->enter(this);
}

void Movable::moveDown(){
    _facing = DOWN;
    if(_location != 0)
        if  (_location->getBottomSite() != 0)
            _location->getBottomSite()->enter(this);
}

void Movable::moveLeft(){
    _facing = LEFT;
    if(_location != 0)
        if  (_location->getLeftSide() != 0)
            _location->getLeftSide()->enter(this);
}